<?php
//session_start();
ob_start('ob_gzhandler');
include_once('config.php');

/*$qr = mysql_query("SELECT * FROM baiviet");
while($row = mysql_fetch_array($qr)){
	echo $row['name'].'<br>';
	$id = $row['idTin'];
	$name = $row['MoTa'];
	$name_rewrite = $row['MoTa_KhongDau'];
	$url_hinh = $row['urlHinh'];
	$description = $row['TomTat'];
	$content = $row['NoiDung'];
	$date_create = $row['Ngay'];
	$date_update = $row['Ngay'];
	$status = $row['status'];
	$metaKeyword = $row['Tags'];
	$other = $row[''];
	$lang = 'vi';
	$menu_id = ",{$row['idMenu']},";
	$user_create = 'admin';
	$user_update = '';
	$delete = '0';
	mysql_query("INSERT INTO info VALUES ('{$id}','{$name}','{$name_rewrite}','{$url_hinh}','{$description}','{$content}','{$date_create}','{$date_update}','{$status}','{$metaKeyword}','{$other}','{$lang}','{$menu_id}','{$user_create}','{$user_update}','{$delete}')");
}*/

$qr = mysql_query("SELECT * FROM menu");
while($row = mysql_fetch_array($qr)){
	echo $row['name'].'<br>';
	
	$id = $row['idMenu'];
	$name = $row['MoTa'];
	$name_rewrite = $row['MoTa_KhongDau'];
	$url = $row['url'];
	$url_hinh = $row['urlHinh'];
	$date_create = $row['Ngay'];
	$date_update = $row['Ngay'];
	$parent_id = $row['menucha'];
	$order = $row['ThuTu'];
	$status = $row['AnHien'];
	$title = $row['MoTa'];
	$metaDescription = $row['MoTa'];
	$metaKeyword = $row['Tags'];
	$other = $row['TrangChu'];
	$lang = 'vi';
	$type_id = $row['idLoai'];
	$position_id = ','.$row['idViTri'];
	$user_create = 'admin';
	$user_update = '';
	$delete = '0';
	
	mysql_query("INSERT INTO menu_v2 VALUES ('{$id}','{$name}','{$name_rewrite}','{$url}','{$url_hinh}','{$date_create}','{$date_update}','{$parent_id}','{$order}','{$status}','{$title}','{$metaDescription}','{$metaKeyword}','{$other}','{$lang}','{$type_id}','{$position_id}','{$user_create}','{$user_update}','{$delete}')");
}


?>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
